#pragma once
#include "NetworkHandler.h"
#include "Defines.h"
#include <irrlicht.h>
#include <string>
// BOOST INCLUDES
#include <boost/thread/thread.hpp>
#include "SocketCommunicator.h"
//#include <boost/shared_ptr.hpp>

class ClientHandler : public NetworkHandler
{
	private:
		bool waitInterrupted;
	public:
		ClientHandler();
		
		void handleReceivedChatLog(const std::string& chatLog);
		void handleReceivedPlayerObjectVector(const std::string& message);
		void handleReceivedAttackObjectVector(const std::string& message);
		void handleReceivedEnemyObjectVector(const std::string& message);
		void handleReceivedDisc(const std::string& name);
		//void handleReceivedReinit(const std::string& name);
		void handleReceivedGrantSeedAndTP(const std::string& seedString);
		void handleReceivedGrantDismantle();
	private:
		void waitLoop();		
		void handleReceivedMessages();
		void prepareSendQueue();
		void sendMessages();
};
